<!--
  Generated template for the AddressPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
    <ion-title>收货地址列表</ion-title>
  </ion-navbar>

</ion-header>


<ion-content padding>
  
    <!-- <ion-list class="address_list">
      
      <ion-item *ngFor="let item of list" >
          <button ion-button clear item-start icon-only >
              <ion-icon name="md-checkmark" color="danger"></ion-icon>
            </button>
            <h2>{{item.name}}  {{item.phone}}</h2>
          <button ion-button clear item-end icon-only >
              <ion-icon name="ios-create-outline"></ion-icon>
          </button>
      </ion-item>
      
    </ion-list> -->

    <ion-list  class="address_list">
        <ion-item *ngFor="let item of list;let key=index">        
          <button ion-button clear item-start icon-only  *ngIf="item.default_address">
              <ion-icon name="md-checkmark" color="danger"></ion-icon>
          </button>
         <div (tap)="changeAddress(item._id)"  (press)="deleteAddress(key,item._id)">
            <h2>{{item.name}}   {{item.phone}}</h2>
            <p>{{item.address}}</p>
         </div>
      
          <button ion-button clear item-end icon-only (tap)="editAddress(item)">
            <ion-icon name="ios-create-outline"></ion-icon>
          </button>
        </ion-item>
      
      </ion-list>
</ion-content>


<ion-footer>
  <ion-toolbar >
     <div class="add_address_btn" [navPush]="AddaddressPage">
       +新建收获地址
     </div>
  </ion-toolbar>
</ion-footer>